package com.syh.jn.scm.service.api.supplier.sale.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * Created by soci.song on 2018/10/18.
 */
public interface SaleReturnOrderEnums {

  @Getter
  @AllArgsConstructor
  public enum State {
    NOT_RECORD(Short.valueOf("0"), "未存在记录"),
    HAVE_RECORD(Short.valueOf("1"), "已存在记录"),

    STAYCONFIRM(Short.valueOf("0"), "待确认"),
    CONFIRM(Short.valueOf("1"), "已确认"),
    HANG(Short.valueOf("2"), "已挂起"),
    STATEMENT(Short.valueOf("3"), "已生成对账单"),
    CANCEL(Short.valueOf("-1"), "已取消订单");

    private Short status;
    private String statusName;

    @Override
    public String toString() {
      return this.status.toString();
    }

    public static State valueOf(Short status) {
      switch (status) {
        case 0:
          return STAYCONFIRM;
        case 1:
          return CONFIRM;
        case 2:
          return HANG;
        case 3:
          return STATEMENT;
        case -1:
          return CANCEL;
      }
      return null;
    }
  }

  @Getter
  @AllArgsConstructor
  public enum DeliveryState {
    LOGISTICS_UN_DELIVERY(Short.valueOf("0"), "未发货"),
    LOGISTICS_PART_DELIVEED(Short.valueOf("1"), "部分发货"),
    LOGISTICS_WHOLE_DELIVEED(Short.valueOf("2"), "全部发货");

    private Short status;
    private String statusName;

    @Override
    public String toString() {
      return this.status.toString();
    }

    public static DeliveryState valueOf(Short status) {
      switch (status) {
        case 0:
          return LOGISTICS_UN_DELIVERY;
        case 1:
          return LOGISTICS_PART_DELIVEED;
        case 2:
          return LOGISTICS_WHOLE_DELIVEED;
      }
      return null;
    }
  }

  @Getter
  @AllArgsConstructor
  public enum CollectState {
    LOGISTICS_UN_COLLECT(Short.valueOf("0"), "未签收"),
    LOGISTICS_PART_COLLECT(Short.valueOf("1"), "部分签收"),
    LOGISTICS_WHOLE_COLLECT(Short.valueOf("2"), "全部签收");

    private Short status;
    private String statusName;

    @Override
    public String toString() {
      return this.status.toString();
    }

    public static CollectState valueOf(Short status) {
      switch (status) {
        case 0:
          return LOGISTICS_UN_COLLECT;
        case 1:
          return LOGISTICS_PART_COLLECT;
        case 2:
          return LOGISTICS_WHOLE_COLLECT;
      }
      return null;
    }
  }

  @Getter
  @AllArgsConstructor
  public enum GeneratedState {
    LOGISTICS_UN_GENERATE(Short.valueOf("0"), "未生成物流单"),
    LOGISTICS_PART_GENERATE(Short.valueOf("1"), "部分生成物流单2"),
    LOGISTICS_WHOLE_GENERATE(Short.valueOf("2"), "完成生成物流单");

    private Short generatedState;
    private String statusName;

    @Override
    public String toString() {
      return this.generatedState.toString();
    }

    public static GeneratedState valueOf(Short generatedState) {
      switch (generatedState) {
        case 0:
          return LOGISTICS_UN_GENERATE;
        case 1:
          return LOGISTICS_PART_GENERATE;
        case 2:
          return LOGISTICS_WHOLE_GENERATE;
      }
      return null;
    }
  }
}
